package models

import (
	"time"

	"github.com/smash-llj/Nexa-server/global"
)

// Friend 好友模型
type Friend struct {
	global.BaseModal
	UserId    int       `gorm:"type:varchar(36);not null;comment:用户ID"`
	FriendId  int       `gorm:"type:varchar(36);not null;comment:好友ID"`
	SessionId string    `json:"sessionId" gorm:"not null"`
	Status    int       `gorm:"default:0;comment:好友状态，0:等待通过，1:已通过 2:已删除 3:不是好友"`
	CreatedAt time.Time `json:"created_at"`

	// 外键关联
	User   User `gorm:"foreignKey:UserId;references:Id;constraint:OnDelete:CASCADE;" json:"-"`
	Friend User `gorm:"foreignKey:FriendId;references:Id;constraint:OnDelete:CASCADE;" json:"-"`
}
